﻿Ext.define('Admin.view.leaveapprove.LeaveApproveGrid', {
    extend: 'Ext.grid.Panel',
	xtype:'leaveapprove-grid',
	id:'leaveapprove-grid',
	title: 'tiele',		//需要修改
	iconCls: 'fa-arrow-circle-o-up',
	//cls: 'user-grid', //需要修改
	controller: 'leaveapprove',
    viewModel : { type: 'leaveapprove'},
	bind: '{leaveapproveStore}',//调用组件4
	//sm:new Ext.grid.CheckboxSelectionModel(),
	columns: [{
				xtype: 'actioncolumn',
				items: [{
					xtype: 'button',
					iconCls: 'x-fa fa-pencil',
					getClass: function(v, meta, rec) {
			            if (rec.get('assignee')!='') {
			                  return 'x-hidden';
			            }
			            return 'x-fa fa-pencil';
					},
					handler: 'onClickLeaveApproveClaimButton'	//ajax  taskId
				},{
					xtype: 'button',
					iconCls: 'x-fa fa-close',
					getClass: function(v, meta, rec) {
			            if (rec.get('assignee')=='') {
			                  return 'x-hidden';
			            }
			            return 'x-fa fa-close';
					},
					handler: 'onClickLeaveApproveCompleteWindowButton'	//taskDefinitionKey 动态表单
				}],
				cls: 'content-column',
				width: 120,
				dataIndex: 'bool',
				text: 'Actions',
				tooltip: 'edit '
			}
			,{header: 'id' 			,dataIndex: 'id',width: 60,sortable: true	,hidden:true}
			,{header: 'userId'  		,dataIndex: 'userId',width: 60,sortable: true}
			,{header: 'startTime' 	,dataIndex: 'startTime',width: 150,sortable: true,renderer: Ext.util.Format.dateRenderer('Y/m/d H:i:s')}
			,{header: 'endTime' 			,dataIndex: 'endTime',width: 150,sortable: true,renderer: Ext.util.Format.dateRenderer('Y/m/d H:i:s')}
			,{header: 'realityStartTime' 	,dataIndex: 'realityStartTime',width: 150,sortable: true,renderer: Ext.util.Format.dateRenderer('Y/m/d H:i:s')}
			,{header: 'realityEndTime' 	,dataIndex: 'realityEndTime',width: 150,sortable: true,renderer: Ext.util.Format.dateRenderer('Y/m/d H:i:s')}
			,{header: 'applyTime' 	,dataIndex: 'applyTime',width: 150,sortable: true,renderer: Ext.util.Format.dateRenderer('Y/m/d H:i:s')}
			,{header: 'leaveType'  	,dataIndex: 'leaveapproveType',width: 80,sortable: true}
			,{header: 'reason' 		,dataIndex: 'reason',width: 80,sortable: true}
			,{header: 'processInstanceId' ,dataIndex: 'processInstanceId',width: 80,sortable: true}
			,{header: 'taskId'  		,dataIndex: 'taskId',width: 80,sortable: true}
			,{header: 'taskName'  		,dataIndex: 'taskName',width: 80,sortable: true}
			,{header: 'taskCreateTime'  ,dataIndex: 'taskCreateTime',width: 150,sortable: true,renderer: Ext.util.Format.dateRenderer('Y/m/d H:i:s')}
			,{header: 'assignee'  		,dataIndex: 'assignee',width: 80,sortable: true}
			,{header: 'taskDefinitionKey',dataIndex: 'taskDefinitionKey',width: 80,sortable: true}
			,{header: 'processDefinitionId'	,dataIndex: 'processDefinitionId',width: 80,sortable: true}
			,{header: 'suspended'  		,dataIndex: 'suspended',width: 80,sortable: true}
			,{header: 'version'  		,dataIndex: 'version',width: 60,sortable: true}
	],
	dockedItems: [{
	    xtype: 'pagingtoolbar',
	    dock: 'bottom',
		bind: '{leaveapproveStore}',	//调用组件4
	    displayInfo: true,
	    items: ['-',{
            text: 'Add',
            iconCls: 'x-fa fa-plus',
			listeners: {
				click: 'onClickLeaveApproveGridAddButton'
            }
        }, '-',{
            text: 'Update',
            iconCls: 'x-fa fa-pencil',
            listeners: {
				click: 'onClickLeaveApproveGridUpdateButton'
            }
        }, '-', {
            text: 'Delete',
            iconCls: 'x-fa fa-close',
			listeners: {
				click: 'onClickLeaveApproveGridDeleteButton'
            }
        }]
	}]
});
